import Vue from "vue";

const state = {
  dialog: {
    // SaveFolderDlg: true
    // LoginPluginDlg: true,
  }
};
const getters = {
  /** 是否为搜索视图,是否有分类搜索和搜索字段 */
  isOpen: state => key => {
    return !!state.dialog[key];
  }
};
const mutations = {
  /** 是否为搜索视图,是否有分类搜索和搜索字段 */
  isOpen: state => key => {
    return !!state.dialog[key];
  },
  openDialog: (state, { key, value = true }) => {
    Vue.set(state.dialog, key, value);
  },
  closeDialog: (state, key) => {
    Vue.delete(state.dialog, key);
  }
};

const actions = {
  //   updateGenerateImg({ state }) {}
};
export default {
  namespaced: true,
  state,
  getters,
  mutations,
  actions
};
